package main

import (
	"go_study/handler"

	"github.com/gin-gonic/gin"
)

func main() {
	//数据库连接初始化

	//初始化路由
	router := gin.Default()

	//创建路由组
	routerGroup := router.Group("/user")

	//创建数据库--localhost:8080/user/createTable
	routerGroup.POST("/createTable", handler.CreateTableHandler)

	//注册--localhost:8080/user/registe
	routerGroup.POST("/registe", handler.RegisteHandler)

	//登陆--localhost:8080/user/login
	routerGroup.POST("/login", handler.LoginHandler)

	//运行在8080端口
	router.Run(":8080")
}
